package edu.kit.aifb.lidasora.ppmModel.transitionCount;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * This class models a simple decrement transition count
 * 
 * This class models a simple transition count. For each true prediction, the
 * count is incremented by one and for each wrong prediction it is decremented
 * by one. Note that by this way, the count may get negative. This class
 * is thread-safe.
 * 
 * @author Daniel
 * @see TransitionCount
 */
public class SimpleDecrement extends TransitionCount {


	/**
	 * {inheritDoc}
	 */
	@Override
	public void truePrediction() {
		count.incrementAndGet();
	}

	/**
	 * {inheritDoc}
	 */
	@Override
	public void falsePrediction() {
		count.decrementAndGet();

	}

	/**
	 * {inheritDoc}
	 */
	@Override
	public double getTransitionValue() {
		return count.get();
	}
	
	@Override
	public void reset(){
		count = new AtomicInteger(1);
	}

}
